package com.casper.olympiad;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class DeletingNumbers {
	public static void main(String[] args) throws IOException {
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer tokenizer =new StringTokenizer(reader.readLine());
		
		int a=Integer.parseInt(tokenizer.nextToken());
		int b=Integer.parseInt(tokenizer.nextToken());
		int c=generatePrimes(a,b);
			
	}
	private static int generatePrimes(int maxNum,int delete) {
		StringBuilder builder=new StringBuilder();
		int num=3;
		boolean status;
		builder.append('2');
		for ( int count = 2 ; count <=maxNum ;  )
	      {
			status = true;
	         for ( int j = 2 ; j <= Math.sqrt(num) ; j++ )
	         {
	            if ( num%j == 0 )
	            {
	               status = false;
	               break;
	            }
	         }
	         if ( status)
	         {
	        	builder.append(num);
	            count++;
	         }
	         num++;
	      }
		return Integer.parseInt(builder.toString());
	}

}
